class Allegato < ActiveRecord::Base
  acts_as_paranoid unless SHOW_DELETED
  has_attached_file :file_allegato, :whiny => false,
    :styles => { :medium => "240x240>", :thumbnail => [ "80x80>", :jpg ] },
    :keep_old_files => true

  belongs_to :allegato_ref, :polymorphic => true
  validates_presence_of :name, :file_allegato_file_name, :allegato_ref_type, :allegato_ref_id
  #validates_attachment_content_type :file_allegato, :content_type => ['text/plain', 'application/pdf', 'application/msword']
  validates_attachment_size   :file_allegato, :less_than => 15.megabytes
end
